<?php
	include_once $_SERVER["DOCUMENT_ROOT"].'/service/entite/uc/UcEntite.php';
	include_once $_SERVER["DOCUMENT_ROOT"].'/persistence/uc/UcDAO.php';

	class UcService {
		
		private function UcService() {
			//évite la construction
		}
		
		public static function createUc() {
			return new UcEntite();
		}
		
		public static function getUcForModification($id) {
			return UcDAO::getUcByID($id);
		}
		
		public static function supprimerUc($id) {
			return UcDAO::delete($id);
		}
		
		public static function save(UcEntite $ucEntite) {
			return UcDAO::save($ucEntite);
		}
		
		public static function getListeUc() {
			return UcDAO::getListeUc();
		}
		
		public static function getListeRoleAssocieAUc($idUc) {
			$listeIdRole = UcDAO::getListeIdRoleAssocieAUc($idUc);
			$listeRole = RoleDAO::getListeRoleById($listeIdRole);
			return $listeRole;
		}
		public static function saveListeIdRole($uc, $listeIdRole) {
			UcDAO::saveListeIdRole($uc, $listeIdRole);
		}
	}
?>